import axios from 'axios'
export async function getRoleList(page,limit){
    var resp = await axios.get("/api/petsSystem/role.do",{
        params:{
            page,
            limit
        }
    });
    return resp.data.data;
}

export async function addRole(role){
    var resp = await axios.get("/api/petsSystem/role.do",{
        params:{
            method:"addRole",
            roleName:role.roleName
        }
    });
    return resp.data;
}

export async function queryRoles(page,limit,roleName){
    var resp = await axios.get("/api/petsSystem/role.do",{
        params:{
            method:"queryRole",
            page,
            limit,
            roleName
        }
    });
    return resp.data;
}

export async function deleteRoleById(roleId){
    var resp = await axios.get("/api/petsSystem/role.do",{
        params:{
            method:"deleteRole",
            roleId
        }
    });
    return resp.data;
}
export async function checkRole(page,limit,roleId){
    var resp = await axios.get("/api/petsSystem/role.do",{
        params:{
            method:"checkRole",
            page,
            limit,
            roleId
        }
    });
    return resp.data;
}

export async function roleDistribution(){
    var resp = await axios.get("/api/petsSystem/role.do",{
        params:{
            method:"roleDistribution",
        }
    });
    return resp.data;
}

export async function getUserRole(userId){
    var resp = await axios.get("/api/petsSystem/role.do",{
        params:{
            method:"getUserRole",
            userId
        }
    });
    return resp.data;
}

export async function changeUserRole(value,userId){
    var resp = await axios.get("/api/petsSystem/role.do",{
        params:{
            method:"changeUserRole",
            value,
            userId,
            
        }
    });
    return resp.data;
}







